//
//  RootViewController.h
//  midiApp
//
//  Created by Laurent Novac on 17.02.11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

#define TOUCH_SURFACE_WIDTH 768
#define TOUCH_SURFACE_HEIGHT 903
#define TOUCH_NORMALIZED_WIDTH 100
#define TOUCH_NORMALIZED_HEIGHT 100
@class RootView;
@class TouchSurfaceView;
@class Position;
@class PositionQueue;
@class PositionStack;

@interface RootViewController : UIViewController {
	IBOutlet RootView* rootView;
	IBOutlet TouchSurfaceView * touchSurface;
	IBOutlet UILabel* xLabel;
	IBOutlet UILabel* yLabel;
	IBOutlet UISwitch* repeatMode;//conditional switch for different modes
	IBOutlet UISwitch* roundTripMode;
	Position* normalizedPosition; //takes the normalized position of touch in the view
	PositionQueue* positionQueue;//a queue
	PositionStack* positionStack;//a stack
	Position* qPos;//a shared pointer for the stack and the queue, no need for accessors
}
@property (nonatomic,retain) IBOutlet RootView* rootView;
@property (nonatomic,retain) IBOutlet TouchSurfaceView * touchSurface;
@property (nonatomic,retain) IBOutlet UILabel* xLabel;
@property (nonatomic,retain) IBOutlet UILabel* yLabel;
@property (nonatomic,retain) IBOutlet UISwitch* repeatMode;
@property (nonatomic,retain) IBOutlet UISwitch* roundTripMode;
@property (nonatomic,retain)Position* normalizedPosition;
@property (nonatomic,retain)PositionQueue* positionQueue;
@property (nonatomic,retain)PositionStack* positionStack;

-(CGPoint)normalizeValue:(CGPoint)value;
-(void)repeat;
-(void)roundTrip:(NSTimer*)timer;

@end
